package com.codeerror.demo.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.codeerror.demo.R;
import com.codeerror.demo.ui.Activity.ConcentrateActivity;
import com.codeerror.demo.ui.Activity.StarActivity;

public class OtherFragment extends Fragment {
    private Button btnExploreStar, btnConcentrate;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_other, container, false);
        initView(view);
        initListener();
        return view;
    }

    private void initListener() {
        btnExploreStar.setOnClickListener(view ->
                getActivity().startActivity(new Intent(getActivity(), StarActivity.class)));
        btnConcentrate.setOnClickListener(view ->
                getActivity().startActivity(new Intent(getActivity(), ConcentrateActivity.class)));

    }

    private void initView(View view) {
        btnExploreStar = view.findViewById(R.id.btn_other_btn_explore_stars);
        btnConcentrate = view.findViewById(R.id.btn_other_btn_concentrate);
    }
}
